package com.xy;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/6/12 16:29
 * @description
 */
public abstract class OrganizationComponent {
    private String name;
    private String des;

    /**
     * 默认实现
     * @param o
     */
    protected void add(OrganizationComponent o) {
        throw new UnsupportedOperationException("该方法不支持");
    }

    protected void remove(OrganizationComponent o) {
        throw new UnsupportedOperationException("该方法不支持");
    }

    public OrganizationComponent(String name, String des) {
        this.name = name;
        this.des = des;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    /**
     * 打印方法
     */
    protected abstract void print();
}

